import Vue from 'vue'
import Router from 'vue-router'  // 引入vue-router

Vue.use(Router)  // 在vue中注入Router
// 配置路由路径
const routes = [
  {
    path: '/login',
    name: 'login',
    hidden: false,//判断是否显示在导航区
    meta: {
      title: "登录"
    },
    component: () => import('@/views/login/index.vue'),
  },
  {
    path: '/',
    redirect: '/menu',
    hidden: false,
  },

  // 导航菜单
  {
    path: '/menu',
    name: 'menu',
    hidden: false,
    component: () => import('../views/Main.vue'),
    children: [
      {
        path: 'SelfAssessment',
        name: 'SelfAssessment',
        hidden: true,
        component: () => import('../views/SelfAssessment.vue'),
        meta: {
          title: '消保自评'
        },
        children: [
          {
            path: 'RectTaskRelease',
            name: 'RectTaskRelease',
            hidden: true,
            component: () => import('../views/RectTaskRelease.vue'),
            meta: {
              title: '整改任务发布'
            },
          },
          {
            path: 'lookTask',
            name: 'lookTask',
            hidden: false,
            component: () => import('../views/lookTask.vue'),
          },
          {
            path: 'addRectTask',
            name: 'addRectTask',
            hidden: false,
            component: () => import('../views/addRectTask.vue'),
          },
          {
            path: 'SituationReport',
            name: 'SituationReport',
            hidden: true,
            component: () => import('../views/SituationReport.vue'),
            meta: {
              title: '整改情况报备'
            },
          },
        ]
      },
      {
        path: 'SpecialWork',
        name: 'SpecialWork',
        hidden: true,
        component: () => import('../views/SpecialWork.vue'),
        meta: {
          title: '专项工作'
        },
        children: [
          {
            path: 'TaskRelease',
            name: 'TaskRelease',
            hidden: true,
            component: () => import('../views/TaskRelease.vue'),
            meta: {
              title: '任务发布'
            },
          },
          {
            path: 'MattersFilling',
            name: 'MattersFilling',
            hidden: true,
            component: () => import('../views/MattersFilling.vue'),
            meta: {
              title: '事项填报'
            },
          },
        ]
      },
      {
        path: 'Regulatory',
        name: 'Regulatory',
        hidden: true,
        component: () => import('../views/Regulatory.vue'),
        meta: {
          title: '消保监管评价'
        },
        children: [
          {
            path: 'ReTaskRelease',
            name: 'ReTaskRelease',
            hidden: true,
            component: () => import('../views/ReTaskRelease.vue'),
            meta: {
              title: '任务发布'
            },
          },
          {
            path: 'ReAssign',
            name: 'ReAssign',
            hidden: true,
            component: () => import('../views/ReAssign.vue'),
            meta: {
              title: '任务分派'
            },
          }
        ]
      },

      {
        path: 'Statistical',
        name: 'Statistical',
        hidden: true,
        component: () => import('../views/Statistical.vue'),
        meta: {
          title: '统计信息'
        },
      },
      {
        path: 'Manage',
        name: 'Manage',
        hidden: true,
        component: () => import('../views/Manage.vue'),
        meta: {
          title: '管理工具'
        },
      },
      {
        path: 'Knowledge',
        name: 'Knowledge',
        hidden: true,
        component: () => import('../views/Knowledge.vue'),
        meta: {
          title: '知识库'
        },
      }
    ]
  },

]
// 将路径注入到Router中
var router = new Router({
  'mode': 'hash',
  routes
})
// 导出路由
export default router;
